package com.example.donghuihui.androidframe.http;
import com.example.donghuihui.androidframe.utils.HttpAPI;

import org.xutils.common.Callback.CommonCallback;
import org.xutils.http.RequestParams;
import org.xutils.x;

import java.io.File;

/**
 * 网络连接  实体操作类
 */
public class AppHttpClient {
    /**
     * 登陆方法
     * @param callBack 回调接口
     */
    public void login(String json,CommonCallback<String> callBack) {
        RequestParams entity = new RequestParams(HttpAPI.APPLOGIN);
        entity.addBodyParameter("",json);
        x.http().post(entity, callBack);
    }
    public void postfile(String path,CommonCallback<String> callBack) {
        RequestParams entity = new RequestParams();
        entity.addBodyParameter("",new File(path));

    }
}
